package com.kehutong.wxapi.response;

import org.coraframework.json.JSON;
import org.coraframework.json.annotation.JSONField;

import java.util.List;

/**
 * @author: liukunlong
 * @date: 2021-03-04 14:10
 */
public class ExternalContactGetResponse {
    public static void main(String[] args) {
        String json="{\n" +
                "   \"errcode\": 0,\n" +
                "   \"errmsg\": \"ok\",\n" +
                "   \"external_contact\":\n" +
                "   {\n" +
                "        \"external_userid\":\"woAJ2GCAAAXtWyujaWJHDDGi0mACHAAA\",\n" +
                "        \"name\":\"李四\",\n" +
                "        \"position\":\"Manager\",\n" +
                "        \"avatar\":\"http://p.qlogo.cn/bizmail/IcsdgagqefergqerhewSdage/0\",\n" +
                "        \"corp_name\":\"腾讯\",\n" +
                "        \"corp_full_name\":\"腾讯科技有限公司\",\n" +
                "        \"type\":2,\n" +
                "        \"gender\":1,\n" +
                "        \"unionid\":\"ozynqsulJFCZ2z1aYeS8h-nuasdAAA\",\n" +
                "        \"external_profile\":\n" +
                "        {\n" +
                "             \"external_attr\":\n" +
                "              [\n" +
                "                {\n" +
                "                  \"type\":0,\n" +
                "                  \"name\":\"文本名称\",\n" +
                "                   \"text\":\n" +
                "                    {\n" +
                "                       \"value\":\"文本\"\n" +
                "                    }\n" +
                "                },\n" +
                "                {\n" +
                "                  \"type\":1,\n" +
                "                  \"name\":\"网页名称\",\n" +
                "                  \"web\":\n" +
                "                  {\n" +
                "                      \"url\":\"http://www.test.com\",\n" +
                "                      \"title\":\"标题\"\n" +
                "                  }\n" +
                "                },\n" +
                "                {\n" +
                "                  \"type\":2,\n" +
                "                  \"name\":\"测试app\",\n" +
                "                  \"miniprogram\":\n" +
                "                  {\n" +
                "                      \"appid\": \"wx8bd80126147df384\",\n" +
                "                      \"pagepath\": \"/index\",\n" +
                "                      \"title\": \"my miniprogram\"\n" +
                "                  }\n" +
                "                }\n" +
                "              ]\n" +
                "      }\n" +
                "     },\n" +
                "     \"follow_user\":\n" +
                "      [\n" +
                "        {\n" +
                "          \"userid\":\"rocky\",\n" +
                "          \"remark\":\"李部长\",\n" +
                "          \"description\":\"对接采购事务\",\n" +
                "          \"createtime\":1525779812,\n" +
                "          \"tags\":\n" +
                "           [\n" +
                "               {\n" +
                "                  \"group_name\":\"标签分组名称\",\n" +
                "                  \"tag_name\":\"标签名称\",\n" +
                "                  \"tag_id\":\"etAJ2GCAAAXtWyujaWJHDDGi0mACHAAA\",\n" +
                "                  \"type\":1\n" +
                "               }\n" +
                "           ],\n" +
                "           \"remark_corp_name\":\"腾讯科技\",\n" +
                "           \"remark_mobiles\":\n" +
                "            [\n" +
                "              \"13800000001\",\n" +
                "              \"13000000002\"\n" +
                "            ],\n" +
                "           \"oper_userid\":\"rocky\",\n" +
                "           \"add_way\":1\n" +
                "        },\n" +
                "        {\n" +
                "          \"userid\":\"tommy\",\n" +
                "          \"remark\":\"李总\",\n" +
                "          \"description\":\"采购问题咨询\",\n" +
                "          \"createtime\":1525881637,\n" +
                "          \"state\":\"外联二维码1\",\n" +
                "          \"oper_userid\":\"woAJ2GCAAAXtWyujaWJHDDGi0mACHAAA\",\n" +
                "           \"add_way\":3\n" +
                "         }\n" +
                "     ],\n" +
                "     \"next_cursor\":\"NEXT_CUROSR\"\n" +
                "}\n";
        ExternalContactGetResponse pp = JSON.parseObject(json, ExternalContactGetResponse.class);


        System.out.println(pp.getExternalContact().getExternalUserid());
        System.out.println(pp.getExternalContact().getName());
        System.out.println(pp.getExternalContact().getCorpName());
    }


    /**
     * errcode
     */ /**
     * errcode : 0
     * errmsg : ok
     * external_contact : {"external_userid":"woAJ2GCAAAXtWyujaWJHDDGi0mACHAAA","name":"李四","position":"Manager","avatar":"http://p.qlogo.cn/bizmail/IcsdgagqefergqerhewSdage/0","corp_name":"腾讯","corp_full_name":"腾讯科技有限公司","type":2,"gender":1,"unionid":"ozynqsulJFCZ2z1aYeS8h-nuasdAAA","external_profile":{"external_attr":[{"type":0,"name":"文本名称","text":{"value":"文本"}},{"type":1,"name":"网页名称","web":{"url":"http://www.test.com","title":"标题"}},{"type":2,"name":"测试app","miniprogram":{"appid":"wx8bd80126147df384","pagepath":"/index","title":"my miniprogram"}}]}}
     * follow_user : [{"userid":"rocky","remark":"李部长","description":"对接采购事务","createtime":1525779812,"tags":[{"group_name":"标签分组名称","tag_name":"标签名称","tag_id":"etAJ2GCAAAXtWyujaWJHDDGi0mACHAAA","type":1}],"remark_corp_name":"腾讯科技","remark_mobiles":["13800000001","13000000002"],"oper_userid":"rocky","add_way":1},{"userid":"tommy","remark":"李总","description":"采购问题咨询","createtime":1525881637,"state":"外联二维码1","oper_userid":"woAJ2GCAAAXtWyujaWJHDDGi0mACHAAA","add_way":3}]
     * next_cursor : NEXT_CUROSR
     */

    @JSONField(name = "errcode")
    private Integer errcode;
    /**
     * errmsg
     */
    @JSONField(name = "errmsg")
    private String errmsg;
    /**
     * externalContact
     */
    @JSONField(name = "external_contact")
    private ExternalContactDTO externalContact;
    /**
     * followUser
     */
    @JSONField(name = "follow_user")
    private List<FollowUserDTO> followUser;
    /**
     * nextCursor
     */
    @JSONField(name = "next_cursor")
    private String nextCursor;

    public Integer getErrcode() {
        return errcode;
    }

    public void setErrcode(Integer errcode) {
        this.errcode = errcode;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

    public ExternalContactDTO getExternalContact() {
        return externalContact;
    }

    public void setExternalContact(ExternalContactDTO externalContact) {
        this.externalContact = externalContact;
    }

    public List<FollowUserDTO> getFollowUser() {
        return followUser;
    }

    public void setFollowUser(List<FollowUserDTO> followUser) {
        this.followUser = followUser;
    }

    public String getNextCursor() {
        return nextCursor;
    }

    public void setNextCursor(String nextCursor) {
        this.nextCursor = nextCursor;
    }

    public static class ExternalContactDTO {
        /**
         * externalUserid
         */ /**
         * external_userid : woAJ2GCAAAXtWyujaWJHDDGi0mACHAAA
         * name : 李四
         * position : Manager
         * avatar : http://p.qlogo.cn/bizmail/IcsdgagqefergqerhewSdage/0
         * corp_name : 腾讯
         * corp_full_name : 腾讯科技有限公司
         * type : 2
         * gender : 1
         * unionid : ozynqsulJFCZ2z1aYeS8h-nuasdAAA
         * external_profile : {"external_attr":[{"type":0,"name":"文本名称","text":{"value":"文本"}},{"type":1,"name":"网页名称","web":{"url":"http://www.test.com","title":"标题"}},{"type":2,"name":"测试app","miniprogram":{"appid":"wx8bd80126147df384","pagepath":"/index","title":"my miniprogram"}}]}
         */

        @JSONField(name = "external_userid")
        private String externalUserid;
        /**
         * name
         */
        @JSONField(name = "name")
        private String name;
        /**
         * position
         */
        @JSONField(name = "position")
        private String position;
        /**
         * avatar
         */
        @JSONField(name = "avatar")
        private String avatar;
        /**
         * corpName
         */
        @JSONField(name = "corp_name")
        private String corpName;
        /**
         * corpFullName
         */
        @JSONField(name = "corp_full_name")
        private String corpFullName;
        /**
         * type
         */
        @JSONField(name = "type")
        private Integer type;
        /**
         * gender
         */
        @JSONField(name = "gender")
        private Integer gender;
        /**
         * unionid
         */
        @JSONField(name = "unionid")
        private String unionid;
        /**
         * externalProfile
         */
        @JSONField(name = "external_profile")
        private ExternalProfileDTO externalProfile;

        public String getExternalUserid() {
            return externalUserid;
        }

        public void setExternalUserid(String externalUserid) {
            this.externalUserid = externalUserid;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getPosition() {
            return position;
        }

        public void setPosition(String position) {
            this.position = position;
        }

        public String getAvatar() {
            return avatar;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }

        public String getCorpName() {
            return corpName;
        }

        public void setCorpName(String corpName) {
            this.corpName = corpName;
        }

        public String getCorpFullName() {
            return corpFullName;
        }

        public void setCorpFullName(String corpFullName) {
            this.corpFullName = corpFullName;
        }

        public Integer getType() {
            return type;
        }

        public void setType(Integer type) {
            this.type = type;
        }

        public Integer getGender() {
            return gender;
        }

        public void setGender(Integer gender) {
            this.gender = gender;
        }

        public String getUnionid() {
            return unionid;
        }

        public void setUnionid(String unionid) {
            this.unionid = unionid;
        }

        public ExternalProfileDTO getExternalProfile() {
            return externalProfile;
        }

        public void setExternalProfile(ExternalProfileDTO externalProfile) {
            this.externalProfile = externalProfile;
        }

        public static class ExternalProfileDTO {
            /**
             * externalAttr
             */
            @JSONField(name = "external_attr")
            private List<ExternalAttrDTO> externalAttr;

            public List<ExternalAttrDTO> getExternalAttr() {
                return externalAttr;
            }

            public void setExternalAttr(List<ExternalAttrDTO> externalAttr) {
                this.externalAttr = externalAttr;
            }

            public static class ExternalAttrDTO {
                /**
                 * type
                 */ /**
                 * type : 0
                 * name : 文本名称
                 * text : {"value":"文本"}
                 * web : {"url":"http://www.test.com","title":"标题"}
                 * miniprogram : {"appid":"wx8bd80126147df384","pagepath":"/index","title":"my miniprogram"}
                 */

                @JSONField(name = "type")
                private Integer type;
                /**
                 * name
                 */
                @JSONField(name = "name")
                private String name;
                /**
                 * text
                 */
                @JSONField(name = "text")
                private TextDTO text;
                /**
                 * web
                 */
                @JSONField(name = "web")
                private WebDTO web;
                /**
                 * miniprogram
                 */
                @JSONField(name = "miniprogram")
                private MiniprogramDTO miniprogram;

                public Integer getType() {
                    return type;
                }

                public void setType(Integer type) {
                    this.type = type;
                }

                public String getName() {
                    return name;
                }

                public void setName(String name) {
                    this.name = name;
                }

                public TextDTO getText() {
                    return text;
                }

                public void setText(TextDTO text) {
                    this.text = text;
                }

                public WebDTO getWeb() {
                    return web;
                }

                public void setWeb(WebDTO web) {
                    this.web = web;
                }

                public MiniprogramDTO getMiniprogram() {
                    return miniprogram;
                }

                public void setMiniprogram(MiniprogramDTO miniprogram) {
                    this.miniprogram = miniprogram;
                }

                public static class TextDTO {
                    /**
                     * value
                     */ /**
                     * value : 文本
                     */

                    @JSONField(name = "value")
                    private String value;

                    public String getValue() {
                        return value;
                    }

                    public void setValue(String value) {
                        this.value = value;
                    }
                }

                public static class WebDTO {
                    /**
                     * url
                     */ /**
                     * url : http://www.test.com
                     * title : 标题
                     */

                    @JSONField(name = "url")
                    private String url;
                    /**
                     * title
                     */
                    @JSONField(name = "title")
                    private String title;

                    public String getUrl() {
                        return url;
                    }

                    public void setUrl(String url) {
                        this.url = url;
                    }

                    public String getTitle() {
                        return title;
                    }

                    public void setTitle(String title) {
                        this.title = title;
                    }
                }

                public static class MiniprogramDTO {
                    /**
                     * appid
                     */ /**
                     * appid : wx8bd80126147df384
                     * pagepath : /index
                     * title : my miniprogram
                     */

                    @JSONField(name = "appid")
                    private String appid;
                    /**
                     * pagepath
                     */
                    @JSONField(name = "pagepath")
                    private String pagepath;
                    /**
                     * title
                     */
                    @JSONField(name = "title")
                    private String title;

                    public String getAppid() {
                        return appid;
                    }

                    public void setAppid(String appid) {
                        this.appid = appid;
                    }

                    public String getPagepath() {
                        return pagepath;
                    }

                    public void setPagepath(String pagepath) {
                        this.pagepath = pagepath;
                    }

                    public String getTitle() {
                        return title;
                    }

                    public void setTitle(String title) {
                        this.title = title;
                    }
                }
            }
        }
    }

    public static class FollowUserDTO {
        /**
         * userid
         */ /**
         * userid : rocky
         * remark : 李部长
         * description : 对接采购事务
         * createtime : 1525779812
         * tags : [{"group_name":"标签分组名称","tag_name":"标签名称","tag_id":"etAJ2GCAAAXtWyujaWJHDDGi0mACHAAA","type":1}]
         * remark_corp_name : 腾讯科技
         * remark_mobiles : ["13800000001","13000000002"]
         * oper_userid : rocky
         * add_way : 1
         * state : 外联二维码1
         */

        @JSONField(name = "userid")
        private String userid;
        /**
         * remark
         */
        @JSONField(name = "remark")
        private String remark;
        /**
         * description
         */
        @JSONField(name = "description")
        private String description;
        /**
         * createtime
         */
        @JSONField(name = "createtime")
        private Integer createtime;
        /**
         * tags
         */
        @JSONField(name = "tags")
        private List<TagsDTO> tags;
        /**
         * remarkCorpName
         */
        @JSONField(name = "remark_corp_name")
        private String remarkCorpName;
        /**
         * remarkMobiles
         */
        @JSONField(name = "remark_mobiles")
        private List<String> remarkMobiles;
        /**
         * operUserid
         */
        @JSONField(name = "oper_userid")
        private String operUserid;
        /**
         * addWay
         */
        @JSONField(name = "add_way")
        private Integer addWay;
        /**
         * state
         */
        @JSONField(name = "state")
        private String state;

        public String getUserid() {
            return userid;
        }

        public void setUserid(String userid) {
            this.userid = userid;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public Integer getCreatetime() {
            return createtime;
        }

        public void setCreatetime(Integer createtime) {
            this.createtime = createtime;
        }

        public List<TagsDTO> getTags() {
            return tags;
        }

        public void setTags(List<TagsDTO> tags) {
            this.tags = tags;
        }

        public String getRemarkCorpName() {
            return remarkCorpName;
        }

        public void setRemarkCorpName(String remarkCorpName) {
            this.remarkCorpName = remarkCorpName;
        }

        public List<String> getRemarkMobiles() {
            return remarkMobiles;
        }

        public void setRemarkMobiles(List<String> remarkMobiles) {
            this.remarkMobiles = remarkMobiles;
        }

        public String getOperUserid() {
            return operUserid;
        }

        public void setOperUserid(String operUserid) {
            this.operUserid = operUserid;
        }

        public Integer getAddWay() {
            return addWay;
        }

        public void setAddWay(Integer addWay) {
            this.addWay = addWay;
        }

        public String getState() {
            return state;
        }

        public void setState(String state) {
            this.state = state;
        }

        public static class TagsDTO {
            /**
             * groupName
             */ /**
             * group_name : 标签分组名称
             * tag_name : 标签名称
             * tag_id : etAJ2GCAAAXtWyujaWJHDDGi0mACHAAA
             * type : 1
             */

            @JSONField(name = "group_name")
            private String groupName;
            /**
             * tagName
             */
            @JSONField(name = "tag_name")
            private String tagName;
            /**
             * tagId
             */
            @JSONField(name = "tag_id")
            private String tagId;
            /**
             * type
             */
            @JSONField(name = "type")
            private Integer type;

            public String getGroupName() {
                return groupName;
            }

            public void setGroupName(String groupName) {
                this.groupName = groupName;
            }

            public String getTagName() {
                return tagName;
            }

            public void setTagName(String tagName) {
                this.tagName = tagName;
            }

            public String getTagId() {
                return tagId;
            }

            public void setTagId(String tagId) {
                this.tagId = tagId;
            }

            public Integer getType() {
                return type;
            }

            public void setType(Integer type) {
                this.type = type;
            }
        }
    }
}
